<?php
/**
 * 会员基础控制器
 * @author maniac
 */
namespace app\api\controller\v1;

class UserBase extends Base
{
    public function initialize()
    {
        parent::initialize();
        $this->checkUserToken();
    }
    
    /**
     * 校验 userToken
     */
    public function checkUserToken()
    {
        $userToken = input('post.userToken/s', '');
        if (!$userToken) {
            exception('请先登录');
        }
        
        $userid = Aes::decrypt($headers['signature']);
        $member = Members::field('id')->where('id', $userid)->find();
        if (!$member) {
            exception('用户不存在');
        }
    }
}
